package com.thinkingstar.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * @Author : sy
 * @Description :登陆等控制器
 * @Date : Created in 15:47 2018/4/20
 */

@Controller
public class HomeController {

    protected HttpServletRequest request;
    protected HttpServletResponse response;
    protected HttpSession session;

    @ModelAttribute
    public void exc(HttpServletRequest request,HttpServletResponse response){
        this.request=request;
        this.response=response;
        this.session=request.getSession();
    }

    private static final Logger LOGGER = Logger.getLogger(HomeController.class);

    @RequestMapping(value = {"/index"})
    public String index() {
        LOGGER.info("首页" +System.currentTimeMillis());


        return "/baidutile";
    }



}
